import request from '@/utils/request'

// 获取分类数据
export const getCateList = params => request.get('categories', { params })

// 添加分类
export const addCate = cate => request.post('categories', cate)

// 删除分类
export const deleteCate = cateId => request.delete(`categories/${cateId}`)

// 根据分类ID获取分类信息
export const getCateInfoById = cateId => request.get(`categories/${cateId}`)

// 修改分类信息
export const modifyCateInfo = (cateId, catName) => request.put(`categories/${cateId}`, { cat_name: catName })
